package com.hk.web.domain.entity;

import com.hk.commons.domain.entity.IdEntity;
import com.hk.commons.enums.OperationEvent;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 *
 * @author Antinomy
 * @date 17/12/11
 */
@Entity
@DynamicInsert
@DynamicUpdate
@EntityListeners(AuditingEntityListener.class)
public class OperationLog extends IdEntity {

    @Column(columnDefinition = "bigint(22) NOT NULL comment '操作用户ID'")
    private Long operatorId;

    @Column(columnDefinition = "varchar(10) comment '操作人'")
    private String operatorName;

    @Column(columnDefinition = "varchar(15) comment '操作人手机'")
    private String operatorMobile;

    @Column(columnDefinition = "longtext comment '事件请求Json'")
    private String eventRequestJson;

    @Column(columnDefinition = "varchar(50) NOT NULL comment '主事件类型'")
    @Enumerated(EnumType.STRING)
    private OperationEvent event;

    @Column(columnDefinition = "varchar(100)comment '事件详情'")
    private String eventDesc;

    @Column(columnDefinition = "varchar(50) comment '客户终端的IP 地址'")
    private String terminalIP;

    @Column(columnDefinition = "varchar(100) comment '操作项名'")
    private String operateItemName;

    @Column(columnDefinition = "varchar(22) comment '操作项Id'")
    private String operateItemId;

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getOperatorMobile() {
        return operatorMobile;
    }

    public void setOperatorMobile(String operatorMobile) {
        this.operatorMobile = operatorMobile;
    }

    public String getEventRequestJson() {
        return eventRequestJson;
    }

    public void setEventRequestJson(String eventRequestJson) {
        this.eventRequestJson = eventRequestJson;
    }

    public OperationEvent getEvent() {
        return event;
    }

    public void setEvent(OperationEvent event) {
        this.event = event;
    }

    public String getEventDesc() {
        return eventDesc;
    }

    public void setEventDesc(String eventDesc) {
        this.eventDesc = eventDesc;
    }

    public String getTerminalIP() {
        return terminalIP;
    }

    public void setTerminalIP(String terminalIP) {
        this.terminalIP = terminalIP;
    }

    public String getOperateItemName() {
        return operateItemName;
    }

    public void setOperateItemName(String operateItemName) {
        this.operateItemName = operateItemName;
    }

    public String getOperateItemId() {
        return operateItemId;
    }

    public void setOperateItemId(String operateItemId) {
        this.operateItemId = operateItemId;
    }
}
